<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<link rel="shortcut icon" href="../resources/favicon.ico" th:href="@{/static/favicon.ico}"/>
<link th:href="@{/static/bootstrap/css/bootstrap.min.css}" rel="stylesheet"/>
<link th:href="@{/static/layui/css/layui.css}"  rel="stylesheet" />
<link th:href="@{/static/bootstrap/toastr/toastr.min.css}" rel="stylesheet"/>
<link th:href="@{/static/font-awesome/css/font-awesome.min.css}" type="text/css" rel="stylesheet"/>
<link th:href="@{/static/layui/css/select.css}"  type="text/css" rel="stylesheet"/>
<link th:href="@{/static/bootstrap/editable/css/bootstrap-editable.css}" rel="stylesheet" />
<link th:href="@{/static/bootstrap/table/bootstrap-table.min.css}"  rel="stylesheet" />
<link th:href="@{/static/bootstrap/zTree/bootstrap.zTree.css}"  rel="stylesheet" />
<link th:href="@{/static/bootstrap/select/bootstrap-select.css}"  rel="stylesheet" />
<link th:href="@{/static/bootstrap/treeTable/bootstrap-treetable.min.css}"  rel="stylesheet" />
</head>
<body>
<div class="container-div">
<shiro:hasPermission name="menu:move"><input type="hidden" id="menu-move" value='mm'/></shiro:hasPermission>
<shiro:hasPermission name="menu:remove"><input type="hidden" id="menu-remove" value='mr'/></shiro:hasPermission>
	<div class="row" style="margin-left:0px;margin-right:0px;">            
		<div class="btn-group-sm" id="toolbar" role="group" style="margin:15px 0px 5px 15px;">
	        <button shiro:hasPermission="menu:add" class="btn btn-success" id="addBtn">
                   <i class="fa fa-plus"></i> <span id='addSpan'>新增目录</span>
            </button>
             <button shiro:hasPermission="menu:edit" class="btn btn-success" id="editBtn">
	            <i class="fa fa-edit"></i> <span id='editSpan'>编辑目录</span>
	        </button> 
            <button class="btn btn-success" id="expandAllBtn">
                <i class="fa fa-exchange"></i> 展开/折叠
            </button>
            <div class="input-group" style="width:22%;float: right;margin-right: 15px;">
				<input id="search_key" class="form-control" type="text" placeholder="请输入菜单/目录名关键字...">
				<span class="input-group-addon" style="color: white; background: #5cb85c;"><i id="key" onclick="selectByKey()" class="fa fa-search"></i></span>
			</div>
        </div>
      		 <div class="col-sm-12 select-table table-striped">
            <table id="demo"></table>
        </div>
    </div>
</div>



<!--新增或者编辑的弹出框-->
<div class="modal fade" id="menuModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header" style="padding:0px">
            	<h4 class="modal-title" style="text-align:center">资源信息</h4>
            </div>
			<form class="form-horizontal m" id="menuForm" >
			    <input type="hidden" name="menuId" id="menuId">
			    <input type="hidden" name="parentId" id="parentId">
		        <div class="modal-body">
					
				<div class="form-group">
					<label class="col-sm-3 control-label ">上级菜单：</label>
					<div class="col-sm-8">
						<div class="input-group">
							<input id="parentName" name="parentName" class="form-control" type="text">
							<span class="input-group-addon"><i id="search" onclick="selectMenuTree()" class="glyphicon glyphicon-list-alt"></i></span>
						</div>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-3 control-label">菜单类型：</label>
					<div class="col-sm-8">
						<select id="menuType" name="menuType" class="selectpicker" title="请选择类型" data-width="150px"></select>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-3 control-label">菜单名称：</label>
					<div class="col-sm-8">
						<input class="form-control" type="text" name="menuName" id="menuName" required>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-3 control-label">展示图标：</label>
					<div class="col-sm-8">
						<input id="icon" name="icon" class="form-control" type="text" placeholder="选择图标">
	                    <div class="ms-parent" style="width: 100%;">
	                        <div class="icon-drop animated flipInX" style="display: none;max-height:200px;overflow-y:auto">
	                            <div data-th-include="@{/menu/icon.html}"></div> 
	                        </div>
	                    </div>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-3 control-label">请求地址：</label>
					<div class="col-sm-8">
						<input id="url" name="url" class="form-control" type="text">
					</div>
				</div>
<!-- 				<div class="form-group">
					<label class="col-sm-3 control-label">打开方式：</label>
					<div class="col-sm-8">
						<select id="target" name="target" class="form-control m-b">
		                    <option value="menuItem">页签</option>
		                    <option value="menuBlank">新窗口</option>
		                </select>
					</div>
				</div> -->
				<div class="form-group">
					<label class="col-sm-3 control-label">权限标识：</label>
					<div class="col-sm-8">
						<input id="perms" name="perms" class="form-control" type="text" >
						<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 控制器中定义的权限标识，如：@RequiresPermissions("")</span>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-3 control-label">排序编号：</label>
					<div class="col-sm-8">
						<input class="form-control" type="text" id="orderNum" name="orderNum" required placeholder="如大于最大节点,数系统将自动排号">
					</div>
				</div>
				
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal" id="close" value="关闭">关闭</button>
                <input id="addOreditBtn" type="button" class="btn btn-primary" value="保存" />
            </div>
            </form>
        </div>
    </div>
</div>

<!-- 菜单树 -->
<div id="pMenuTree" style="display: none;">
	<div id="transfer" style="height:350px;">
		<ul id="parentTree" class="ztree"></ul>
	</div>
</div>
	
<script th:src="@{/static/js/jquery-2.1.1.min.js}"></script>
<script th:src="@{/static/bootstrap/js/bootstrap.min.js}"></script>
<script th:src="@{/static/bootstrap/toastr/toastr.min.js}"></script>
<script th:src="@{/static/layui/layui.all.js}" type="text/javascript"></script>
<script th:src="@{/static/bootstrap/editable/js/bootstrap-editable.js}"></script>
<script th:src="@{/static/bootstrap/table/bootstrap-table.min.js}"></script>
<script th:src="@{/static/bootstrap/table/locale/bootstrap-table-zh-CN.min.js}"></script>
<script th:src="@{/static/bootstrap/table/extensions/editable/bootstrap-table-editable.min.js}"></script>
<script th:src="@{/static/bootstrap/treeTable/bootstrap-treetable.min.js}"></script>
<script th:src="@{/static/bootstrap/zTree/jquery.ztree.core.js}"></script>
<script th:src="@{/static/bootstrap/zTree/jquery.ztree.excheck.js}"></script>
<script th:src="@{/static/bootstrap/zTree/jquery.ztree.exedit.js}"></script>
<script th:src="@{/static/bootstrap/select/bootstrap-select.js}"></script>
<script th:src="@{/static/js/common.js}"></script>
<script th:src="@{/static/js/aboutMenu.js}"></script>
</body>
</html>